@extends('app')
@section('content')
    <div class="page">
        <div class="header">“水榭香堤” 我的竞选</div>
        @if(!$vote->is_lock)
            <div class="tpal"><a href="{{ url('votes/create') }}"><img src="{{ $vote->img_src ? asset($vote->img_src) : asset('web/images/tp.jpg') }}" width="100%" /></a></div>
            @if($vote->id)
                <div class="scsm">您的竞选申请正在处理中</div>
            @else
                <div class="scsm">请上传本人真实照片.姓名信息，参与竞选！</div>
            @endif
        @else
            <div class="tpal"><img src="{{ $vote->img_src ? asset($vote->img_src) : asset('web/images/tp.jpg') }}" width="100%" /></div>
            <div class="wdsc">您已获得 {{ $vote->vote_count }} 票(&#8595;&#8595;最近投票记录&#8595;&#8595;)</div>
        @endif
        @if($posts)
            <ul class="post_list">
                @foreach($posts as $post)
                    <li>{{ $post->user_id ? $post->user()->first()->name : '游客'}}<span>{{ $post->updated_at }}</span></li>
                @endforeach
            </ul>
        @endif
    </div>
@endsection
